# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=yofi
pkgver=0.2.0
pkgrel=2
pkgdesc="A minimalistic menu for wayland"
url="https://github.com/l4l/yofi"
# riscv64: TEXTREL
# s390x: no desktop on this arch
arch="all !riscv64 !s390x"
license="MIT"
makedepends="
	cargo
	cargo-auditable
	fontconfig-dev
	freetype-dev
	wayland-dev
	"
source="https://github.com/l4l/yofi/archive/$pkgver/yofi-$pkgver.tar.gz
	bump-png.patch
	getrandom-0.2.10.patch
	"

# font-fontkit loads fonts via system libraries.
_cargo_opts="--frozen --no-default-features --features=font-fontkit"


prepare() {
	cargo fetch --target="$CTARGET" --locked
	default_prepare
	cargo fetch --target="$CTARGET"  # update after applying patches
}

build() {
	cargo auditable build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	install -D -m755 target/release/yofi -t "$pkgdir"/usr/bin/
}

sha512sums="
d4f386252682e1990b637b31732eeea34f02296dd63199e58f637861fd8f33ef712400c536131a5069068c1096a89b5369688255b5cca391d6fbe4d35832ddf6  yofi-0.2.0.tar.gz
b9f4fc2df6cd7f11e87cc8fb0cabaa97e421f97016bddddc9a00a4c5a7f417f8f70768b7f9a89587015bb81d04b12810f5241b533828d9dbac58affc5ede1194  bump-png.patch
0542b9bec964c4e2f096a20257519ad212a3d0015e3a53522dd0f75760c6d98434d4537c489c02f77a81407d8f1fc6c2cb0141902d511deabd0daf11e148f549  getrandom-0.2.10.patch
"
